<!DOCTYPE html>
<html lang="zh-hans">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<title>安全中心</title>
<link rel="stylesheet" href="__TEMPLATE__/webfile/layer.css" id="layui_layer_skinlayercss">
<link rel="stylesheet" href="__TEMPLATE__/webfile/main.css">
<script src="__TEMPLATE__/sysme/js/jquery-1.9.1.min.js"></script>
<title>安全中心</title>
</head>
<body cz-shortcut-listen="true">
<div class="header">
	<div class="main main_btm_border">
		<div class="left logo">
			<a href="{:url('index/home')}" class="logo-link" id=""><span class="logo_image"></span>
			<style>
.logo_image{background-image:url("__ATTACHMENT__/{$logo.logoimg}")!important}
			</style>
			</a>
		</div>
		<div class="right login_and_userinfo_1">
			<div class="login_header">
				<span class="welcome"></span>
				<div class="mobile_download" style="cursor:pointer">
					<i class="iconfont"></i><i class="iconfont"></i><span class="">手机app下载</span>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="model_2" class="model_2" style="display:none">
	<div class="model_header">
		<h1>温馨提醒</h1>
	</div>
	<div class="model_body">
		<span id="model_content"></span>
	</div>
	<div class="foot_succ">
		<a onclick="jQuery.modal.close()" class="btn btn-default btn-radius">确定</a>
	</div>
</div>
<div class="main usercenter">
	<div class="user_usersafe">
		<div class="user_menu left">
			<h2>会员中心</h2>
			<ul>
				<li class="hover"><i class="iconfont"></i><a href="{:url('user/index')}">个人中心</a></li>
				<li><i class="iconfont"></i><a class="user_goto_finance" href="{:url('user/recharge')}">财务中心</a></li>
				<li><i class="iconfont"></i><a href="{:url('user/callRecord')}">交易记录</a></li>
				<!-- 	<li><i class="iconfont"></i><a href="{:url('user/detail')}">详细设定</a></li> -->
				<li><i class="iconfont"></i><a href="{:url('user/peilvdetail')}">赔率详情</a></li>
				<li><i class="iconfont"></i><a href="{:url('user/message')}">信息公告</a></li>
				<li><i class="iconfont"></i><a href="{:url('user/djsm')}">等级说明</a></li>
			</ul>
			
			<h2>代理中心</h2>
			<ul>
			
				<li><i class="iconfont"></i><a class="user_goto_finance" href="{:url('user/dlCentent')}">代理说明</a></li>
				{if($f.dl==1)}
				<li><i class="iconfont"></i><a href="{:url('user/dailibaobiao')}">代理报表</a></li>
				<li><i class="iconfont"></i><a href="{:url('user/xiajibaobiao')}">下级报表</a></li> 
				<li><i class="iconfont"></i><a href="{:url('user/xiajikaihu')}">下级开户</a></li>
				<!--<li><i class="iconfont"></i><a href="{:url('user/xiajiguanli')}">下级管理</a></li>-->
				<li><i class="iconfont"></i><a href="{:url('user/touzhumingxi')}">投注明细</a></li>
				<li><i class="iconfont"></i><a href="{:url('user/jiaoyimingxi')}">交易明细</a></li>
				{else/}
				{if($open==1)}
				<li><i class="iconfont"></i><a href="{:url('user/shenqing')}">代理申请</a></li>{/if}
				{/if}
			</ul>
		</div>
		<div class="user_right right">
			<div class="usercenter_info">
				<div class="left">
					<div class="avatar left" id="photo" style="width:85px;height:85px;border-radius:50%;position:relative;background:url({if(empty($header))} '__TEMPLATE__/webfile/user_icon.png' {else/} '__UPLOADS__avatar/{$header}' {/if});background-size:100%;">
						<input type="file" style="opacity:0; filter:alpha(opacity=0); height: 85px; width: 85px; position: absolute; top: 0; left: 0; z-index: 9;" onchange="setFiles(this)" id="touxiang">
						<!--<img src="__TEMPLATE__/webfile/user_icon.png" alt="" class="avatar_img">-->
					</div>
					<div class="right user_info">
						<ul>
							<li><label for="username">用 户 名 :</label><span class="userinfo_username">{$user_all.username}</span></li>
					<!-- 	<li><label for="safe_lavel">安全等级:</label><i class="user_star start_light"></i><i class="user_star start_light"></i><i class="user_star start_light"></i><i class="user_star start_dark"></i><i class="user_star start_dark"></i></li> -->
					
							<li><label for="safa_lavel">平台等级:</label>{$usnameclass.class_name}</li>
							<li>
								<a href="{:url('user/djsm')}">
								<label for="login_time" style="float:left;display:block;height:100%;line-height:18px;padding-right:0;color:#000;">等级信息：</label>
								{if(!empty($next_level))}
								<div style="font-size:12px;float:left;width:71%;color:#000;font-weight:normal;font-family:'微软雅黑';text-align: left;line-height:17px;">升级 <span style="color:#E94335;">{$next_level}</span>
									{if($next_money>0 || $next_xml>0 )}</br>
									还需
									{if( $next_money>0 )}<span>充值：{$next_money}元</span>&nbsp{/if}
									{if( $next_xml>0 )}<span>洗码：{$next_xml}元</span>{/if}
									{else/}
									已满足升级条件，下周一自动升级
									{/if}
								</div>
								{/if}
								</a>
							</li>
							
						</ul>
					</div>
				</div>
				<div class="right">
					<div class="account_info">
						<div class="account_balance">
							<label for="_balance">账户总额 :</label><em>{$user_all.je}</em><a href="#" onclick="window.location.reload()" style="margin-left:10px">刷新</a>
						</div>
						<div class="account_topup">
							<a class="btn btn-default topup-btn user_goto_recharge" href="{:url('User/recharge')}">充值</a><a class="btn btn-dark withdraw-btn user_goto_withdraw" href="{:url('User/drawMoney')}">提现</a>
						</div>
					</div>
				</div>
			</div>
			<div class="user_main">
				<div class="user_header">
					<div class="user_header_nav">
						<ul>
							<li><a href="{:url('user/index')}?us=i">安全中心</a></li>
							<li><a href="{:url('user/index')}?us=q">安全信息</a></li>
							<li class="hover"><a href="{:url('user/index')}?us=r">个人资料</a></li>
						</ul>
					</div>
				</div>
				<div id="user_safe" class="user_body">
					<div class="safe_item">
						<div class="safe_item_head login_password pointer">
							<div class="left info_view">
								<i class="iconfont icon-zhuce"></i>
								<div class="left">
									<h3>用户资料</h3>
									<span></span>
								</div>
							</div>
						</div>
						<style>
.form .form_group2{margin:0 auto;width:550px;display:block}.form .form_group2 label{display:inline-block;clear:both;width:90px}.form .form_group2 input{border:1px solid #ddd;border-radius:2px;width:296px;margin-left:5px;padding-left:12px;color:#999;padding-top:14px;font-size:16px;padding-bottom:15px;margin-bottom:15px;margin-top:15px;font-size:14px}
						</style>
						<div class="safe_item_body">
							<div class="change_password">
								<div class="form">
									<form id="changeUserInfoFrom" autocomplete="off" action="{:url('user/mobileqq')}" method="post">
										<div class="form_group2">
											<label>手机号码：</label><input type="text" placeholder="请输入手机号" name="user_mobile" id="user_mobile" value="{$res.mobile}" disabled>
										</div>
										<div class="form_group2">
											<label>注册端：</label><input type="text" name="contact_info" id="contact_info" value="{$res.beizhu}" disabled>
										</div>
										<div class="form_group2">
											<label>QQ号码：</label><input type="text" placeholder="请输入QQ号码" name="user_qq" id="user_qq" value="{$res.qq}">
										</div>
										
										<br>
										<br>
										<br>
										<input style="margin-left:32%;width:280px;" type="submit" class="btn btn-radius btn-default" name="button" id="changeUserInfo" value="确认">
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
	var obj = document.querySelector("#photo");
		var file1 = document.querySelector("#touxiang");
		var tx = document.querySelector("#img");
		obj.addEventListener("click",fn1,false);
//		function fn(){
//			file1.click()
//		}
		file1.addEventListener("change",fn1,false);
		function fn1(){
			files = this.files[0];
			console.log(files)
			var Ofile = new FileReader();
			Ofile.readAsDataURL(files);
			Ofile.onload = function(){
				var self = this;
				$.ajax({
					type: "post",
					url: "/mobile/User/changeHeader",
					data:{img: this.result},
					success: function (data) {
						if( 1==parseInt(data) ){
							obj.style.background= 'url('+self.result+')';
							obj.style.backgroundSize= '100%';
						}else{
							layer.msg('上传失败');
						}
					},
					error:function(){
						layer.msg('上传失败');
					}
				});

			}
		}
		var files;
		var setFiles = function(element){
			files = element.files[0];
		};
</script>

</html>